package Serializable;

import java.io.Serializable;
import klient.ReParser;

/**
 *  
 * @author Marcin & Barte
 * 
 * @description 
 */
public final class ParsedCmd implements Serializable{
    public String mainCmd;
    public int intParam[];
    public String stringParam[];
    public float floatParam[];
    public boolean end;
    public float from;
    public boolean needAnswer=false;
    
    public ParsedCmd(){
        mainCmd="";
        intParam=null;
        stringParam=null;
        end=false;
    }
    public ParsedCmd(String main){
        make(main,null,null,null);
    }
    
    public ParsedCmd(String main, int param){
        int buf[]= new int[1];
        buf[0]=param;
        make(main,buf,null,null);
    }
    
    public ParsedCmd(String main,String param){
        String buf[]= new String[1];
        buf[0]=param;
        make(main,null,buf,null);
    }
    
    public ParsedCmd(String main, int ints[],String str[]){
        make(main,ints,str,null);
    }
    
    public ParsedCmd(String main,String str[]){
        make(main,null,str,null);
    }
    
    public ParsedCmd(String main, int ints[]){
        make(main,ints,null,null);
    }
    
    public ParsedCmd needAnswer(){
        if(!"ALLOK".equals(mainCmd))
            needAnswer = true;
        return this;
    }
    
    @Override
    public String toString(){
        return ReParser.process(this);
    }
    
    public void make(String main, int ints[],String str[],float floats[]){
        mainCmd=main;
        intParam=ints;
        stringParam=str;
        floatParam=floats;
        end=false;
    }

    public boolean isEmpty() {
        return mainCmd.isEmpty();
    }
    
    
}